<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="/hr_man/themes/bootstrap/easyui.css" rel="stylesheet">
<link href="/hr_man/themes/icon.css" rel="stylesheet">
<script type="text/javascript" src="/hr_man/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="/hr_man/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/hr_man/js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
	$(function() {
		var e_id = '${employeeid}';
		$.ajax({
			type : 'post',
			url : '${pageContext.request.contextPath}/findcard',
			data : {
				'card' : e_id
			},
			dataType : "json",
			success : function(data) {
				if (data.card_id != "0") {
					$('#updateCard').form('load', data)
				}
			}
		})
		$("#updateCard").form({
			url : '${pageContext.request.contextPath}/updateCard',
			success : function(data) {

				if (data == "1") {

					$.messager.alert('我的消息', '更新成功', function() {
					});
				} else if (data == "0") {
					$.messager.alert('我的消息', '更新失败', function() {
						$("#updateCard").form('reset');
					});
				} else {
					$.messager.alert('我的消息', '您未添加名片夹', function() {
					});
				}
			}
		})
	})
	function findCardForm() {
		top.$('#showTabs').tabs('add',
						{	title : '查找名片夹',
							fit : true,
							content : "<iframe style='width: 100%;height: 100%'  src='${pageContext.request.contextPath}/cardcase/findcard.jsp'  frameborder='0'></iframe>",
							closable : true,
						});
		var li = top.$(".tabs-wrap ul li:last-child");
		top.$("#close").remove();
		li.after("<li id='close'><a class='tabs-inner' href='javascript:void()' onClick='javascript:closeAll()'>关闭全部</a></li>");
	}
	function updateCardForm() {
		$("#updateCard").form('submit');
	}
</script>
<body>
	<div id="updateEmpsCard" class="easyui-dialog" title="名片夹"
		style="width: 400px; height: 450px;" data-options="modal:true,closable:false,draggable:false">
		<form id="updateCard" method="post">
			<div style="text-align: center;margin-top: 20px;margin-bottom: 20px">
				<span>公司:</span> <input class="easyui-textbox" name="card_company"
					style="width: 50;" />
			</div>
			<div style="text-align: center;margin-bottom: 20px">
				<span>地址:</span> <input class="easyui-textbox" name="card_address"
					style="width: 50;" />
			</div>
			<div style="text-align: center;margin-bottom: 20px">
				<span>电话:</span> <input class="easyui-textbox" name="card_tel"
					style="width: 50;" />
			</div>
			<div style="text-align: center;margin-bottom: 20px">
				<span>邮箱:</span> <input class="easyui-textbox" name="card_email"
					style="width: 50;" />
			</div>
			<div style="text-align: center; padding: 5px 0">
				<a href="javascript:void(0)" class="easyui-linkbutton"
					onclick="updateCardForm()" style="width: 80px">提交</a>
			</div>
			<div style="text-align: center; padding: 5px 0">
				<a href="javascript:void(0)" class="easyui-linkbutton"
					onclick="findCardForm()" style="width: 80px">查看名片夹</a>
			</div>
		</form>
	</div>
</body>
</html>